// Function printSortColHeadWithBeanName
// Modified The doSort Function Name to  dosort+BeanName
// Using With PagingHeaderNopagingLink2
// Modified By Bee 2007-04-03
// -- Param --
// txtBeanName - name of paging bean
// txtFieldLabel - Col label
// txtSearchOn - orderby key
// txtDorA - orderMode ASC or DESC
// imageBase - path of common image folder
// noBrHeadCol - <nobr>
// preValidateMethod - validate form
function printSortColHead(txtBeanName, txtFieldName, txtFieldLabel, txtSearchOn, txtDorA, imageBase, noBrHeadCol) {
	if(typeof(noBrHeadCol) == 'undefined' || noBrHeadCol != true){
		noBrHeadCol = false;
	}
	
    var table_col_last_index = 0;
    var str;
  
    str = '<table width="100%" cellpadding="0" cellspacing="0" border="0" style="BORDER: 0px;" >';
    str = str + '<tr style="text-align:center;">';
    if (txtFieldName == txtSearchOn) {
        if (txtDorA == 'ASC') {
            str = str + '<td width="90%" id="table_col_"' + (table_col_last_index++) + '  style="BORDER:none;font-weight:bold;cursor:hand;text-valign:top;TEXT-DECORATION:underline" tabindex="0" onclick="doSort'+ txtBeanName +'(\'' + txtFieldName + '\',\'DESC\');" >';
        } else {
            str = str + '<td width="90%"  id="table_col_"' + (table_col_last_index++) + '  style="BORDER:none;font-weight:bold;cursor:hand;text-valign:top;TEXT-DECORATION:underline" tabindex="0" onclick="doSort'+ txtBeanName +'(\'' + txtFieldName + '\',\'ASC\');" >';
        }
    } else {
        str = str + '<td width="90%"  id="table_col_"' + (table_col_last_index++) + '   style="BORDER:none;font-weight:bold;cursor:hand;text-valign:top;TEXT-DECORATION:underline" tabindex="0" onclick="doSort'+ txtBeanName +'(\'' + txtFieldName + '\',\'ASC\');" >';
    }
    if (noBrHeadCol == false) {
        str = str + txtFieldLabel;
    } else {
        str = str + '<nobr>' + txtFieldLabel + '</nobr>';
    }
    str = str + '           </td>';
    if (txtFieldName == txtSearchOn) {
        str = str + '<td width="10%" style="text-valign:top" >';
        str = str + '<table width="100%" cellpadding="0" cellspacing="0" border="0"  style="BORDER: 0px;">';
        if (txtDorA == 'ASC') {
            str = str + '<tr><td valign="middle"><img src="' + imageBase + '/arrow_top.gif" ></td></tr>';
        } else {
            str = str + '<tr><td valign="middle"><img src="' + imageBase + '/arrow_down.gif" ></td></tr>';
        }
        str = str + '</table>';
        str = str + '</td>';
    }
    str = str + '</tr>';
    str = str + '</table>';
    document.write(str);
}